PROJECT(alicloud_httpdns_c_sdk_examples LANGUAGES C CXX)

##################################### Example Application ################################
INCLUDE_DIRECTORIES(${CURL_INCLUDE_DIRS})
INCLUDE_DIRECTORIES(${APU_INCLUDE_DIR})
INCLUDE_DIRECTORIES(${APR_INCLUDE_DIR})
INCLUDE_DIRECTORIES(${CJSON_INCLUDE_DIR})
INCLUDE_DIRECTORIES(../src)

FUNCTION(_TARGET_EXAMPLE_LIBRARIES EXAMPLE_BIN_NAME SOURCE_FILES)
    ADD_EXECUTABLE(${EXAMPLE_BIN_NAME} ${SOURCE_FILES})
    TARGET_LINK_LIBRARIES(${EXAMPLE_BIN_NAME} PRIVATE ${CMAKE_PROJECT_NAME}_static ${CURL_LIBRARIES} ${CJSON_LIBRARIES} ${APU_LIBRARIES} ${APR_LIBRARIES})
    IF (CMAKE_HOST_UNIX AND NOT CMAKE_HOST_APPLE)
        TARGET_LINK_LIBRARIES(${EXAMPLE_BIN_NAME} PRIVATE dl)
    ENDIF ()
ENDFUNCTION()

_TARGET_EXAMPLE_LIBRARIES(sync_resolve_example sync_resolve_example.c)

_TARGET_EXAMPLE_LIBRARIES(cxx_integration_example cxx_integration_example.cpp)

_TARGET_EXAMPLE_LIBRARIES(async_resolve_example async_resolve_example.c)

_TARGET_EXAMPLE_LIBRARIES(sdns_resolve_example sdns_resolve_example.c)

_TARGET_EXAMPLE_LIBRARIES(batch_resolve_example batch_resolve_example.c)